package com.yanqu.road.server.cmd.chefduel.process2;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.chefduel.ChefDuelProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.chefduel.CrossChefDuelMgr;
import com.yanqu.road.server.protocol.Protocol;


@Cmd(code = Protocol.C_CROSS_CHEF_DUEL2_COOKER_JOIN, desc = "有能力进入第二阶段的通知跨服")
public class CrossAddCookerCmd extends CrossCommand {

    private int activityId;
    ChefDuelProto.CrossChefDuel2CookerJoinSyncMsg reqMsg;
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        reqMsg = ChefDuelProto.CrossChefDuel2CookerJoinSyncMsg.parseFrom(packet.getBytes());
        activityId = reqMsg.getActivityId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossChefDuelMgr.addPromotion2User(activityId, serverId, reqMsg.getUserInfoListList());
    }

    @Override
    public void sendData() {

    }

}
